<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
 <base href="<%=basePath%>"></base>
<title></title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta content="noindex, nofollow" name="robots" /> 
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<style type="text/css">
a:link     {color: #666666;text-decoration:none;border:2px solid #ffffff}
a:visited  {color: #666666;text-decoration:none;border:2px solid #ffffff}
a:hover    {color: #006E6B;text-decoration:none;border:2px solid #ff0000}
a:avtive   {color: #006E6B;text-decoration:none;border:2px solid #ff0000}
.spantitle{width:75px;border:1px solid #d6d6d6;font-size:12px;height:18px;float:left}
.spandelbt{width:30px;border:1px solid #d6d6d6;color:red;font-size:12px;height:18px;float:left}
</style>
<script language="javascript">
function imgSuitSize(ImgD, width, height){
    var image = new Image();   
    var iwidth = width;
    var iheight = height; 
    image.src = ImgD.src;
    if (image.width > 0 && image.height > 0) {
        flag = true;
        if (image.width / image.height >= iwidth / iheight){
            if (image.width > iwidth) {
                ImgD.width = iwidth;
                ImgD.height = (image.height * iwidth) / image.width;
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
            ImgD.alt = image.width + "×" + image.height;
        } else {
            if (image.height > iheight){
                ImgD.height = iheight;
                ImgD.width = (image.width * iheight) / image.height;
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
            ImgD.alt = image.width + "×" + image.height;
        }
    }       
}
function setimageprop(id){
	window.parent.document.getElementById("imgurladdress").value="/Resource_resNtShow.action?resid="+id;
}
</script>
</head>
<body>
<table border="0" cellspacing="1" cellpadding="0" style="background:#d8d8d8;width:100%">
<tr>
<s:iterator value="resNtList"  status="res">
	<td style="text-align:center;background:#ffffff;padding:4px;clear:both">
	<span style="height:100px">
	<a href="javascript:setimageprop(${id})"><img src="admin/Resource_resNtShow.action?resid=${id}"
	 id="res${id}" onload="imgSuitSize(this,120,75)" border="0" /></a>
	</span>
	<br/>
	<span class="spantitle">
	<s:property value="filename.length()>8?filename.substring(0,8):filename"/>
	</span><span class="spandelbt"><a href="admin/Resource_resNtdelete.action?resid=${id}&amp;templateid=${templateid}" style="border:0;color:red">删除</a></span>
	</td>
	<s:if test="%{(#res.index+1)%4==0}">
		</tr>
		<tr>
	</s:if>	
</s:iterator>
</tr>
</table>
</body>
</html>